package com.codes.core.common.enumtype.enums;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Description 
 * @Date 2020/8/14 10:23
 * @Created  peanut
 */
public class DicCodePool {

    /**
     * 用于存储代码项
     */
    private static final Map<IDicTable, DicCodeBean> codeItemMap = new ConcurrentHashMap<>();

    /**
     * 往 map 中添加代码项
     *
     * @param iCodeItem 枚举类
     * @param code
     * @param text
     */
    public static final void putCodeItem(IDicTable iCodeItem, String code, String text) {
        codeItemMap.put(iCodeItem, new DicCodeBean(code, text));
    }

    static final DicCodeBean getCodeItem(IDicTable iCodeItem) {
        return codeItemMap.get(iCodeItem);
    }
}